package com.example.crawler.controller;

import com.dragonsoftbravo.libs.Opr;
import com.example.crawler.service.ImgService;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author pq
 * @date 2022/10/28 11:42
 * @description
 * @modified
 **/
@RestController
@RequestMapping("/img")
public class ImgController extends BaseController {

    @Resource
    private ImgService imgService;

    @GetMapping("/getImgUrl")
    public ResponseEntity<Opr<List<String>>> getAllImgUrl() {
        return processData(() -> imgService.getImgUrls(), this::processException);
    }
}
